<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Photo Details</f:facet>


        <s:decorate id="added" template="layout/display.xhtml">
            <ui:define name="label">Added</ui:define>
            <h:outputText value="#{photoHome.instance.added}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="cameraBrand" template="layout/display.xhtml">
            <ui:define name="label">Camera brand</ui:define>
            <h:outputText value="#{photoHome.instance.cameraBrand}"/>
        </s:decorate>

        <s:decorate id="cameraModel" template="layout/display.xhtml">
            <ui:define name="label">Camera model</ui:define>
            <h:outputText value="#{photoHome.instance.cameraModel}"/>
        </s:decorate>

        <s:decorate id="dateTaken" template="layout/display.xhtml">
            <ui:define name="label">Date taken</ui:define>
            <h:outputText value="#{photoHome.instance.dateTaken}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="dsc" template="layout/display.xhtml">
            <ui:define name="label">Dsc</ui:define>
            <h:outputText value="#{photoHome.instance.dsc}"/>
        </s:decorate>

        <s:decorate id="filesize" template="layout/display.xhtml">
            <ui:define name="label">Filesize</ui:define>
            <h:outputText value="#{photoHome.instance.filesize}"/>
        </s:decorate>

        <s:decorate id="link" template="layout/display.xhtml">
            <ui:define name="label">Link</ui:define>
            <h:outputText value="#{photoHome.instance.link}"/>
        </s:decorate>

        <s:decorate id="originalheight" template="layout/display.xhtml">
            <ui:define name="label">Originalheight</ui:define>
            <h:outputText value="#{photoHome.instance.originalheight}"/>
        </s:decorate>

        <s:decorate id="originalwidth" template="layout/display.xhtml">
            <ui:define name="label">Originalwidth</ui:define>
            <h:outputText value="#{photoHome.instance.originalwidth}"/>
        </s:decorate>

        <s:decorate id="title" template="layout/display.xhtml">
            <ui:define name="label">Title</ui:define>
            <h:outputText value="#{photoHome.instance.title}"/>
        </s:decorate>

        <s:decorate id="type" template="layout/display.xhtml">
            <ui:define name="label">Type</ui:define>
            <h:outputText value="#{photoHome.instance.type}"/>
        </s:decorate>

        <s:decorate id="viewed" template="layout/display.xhtml">
            <ui:define name="label">Viewed</ui:define>
            <h:outputText value="#{photoHome.instance.viewed}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/PhotoEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty photoFrom ? 'PhotoList' : photoFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Album</h:panelGroup>
        </f:facet>
    <div class="association" id="albumParent">

        <h:outputText value="There is no album associated with this photo."
                   rendered="#{photoHome.instance.album == null}"/>

        <rich:dataTable var="_album"
                   value="#{photoHome.instance.album}"
                rendered="#{photoHome.instance.album != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="albumTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_album.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Access id</f:facet>
                <h:outputText value="#{_album.access.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Category id</f:facet>
                <h:outputText value="#{_album.category.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Created</f:facet>
                <h:outputText value="#{_album.created}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Description</f:facet>
                <h:outputText value="#{_album.description}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Lastupdated</f:facet>
                <h:outputText value="#{_album.lastupdated}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Owner id</f:facet>
                <h:outputText value="#{_album.owner.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Published</f:facet>
                <h:outputText value="#{_album.published}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Title</f:facet>
                <h:outputText value="#{_album.title}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewalbum"
                     value="View"
                      view="/Album.xhtml">
                    <f:param name="albumId"
                           value="#{_album.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Owner</h:panelGroup>
        </f:facet>
    <div class="association" id="ownerParent">

        <h:outputText value="There is no owner associated with this photo."
                   rendered="#{photoHome.instance.owner == null}"/>

        <rich:dataTable var="_user"
                   value="#{photoHome.instance.owner}"
                rendered="#{photoHome.instance.owner != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="ownerTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_user.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Dsc</f:facet>
                <h:outputText value="#{_user.dsc}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_user.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Firstname</f:facet>
                <h:outputText value="#{_user.firstname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Lastloggedin</f:facet>
                <h:outputText value="#{_user.lastloggedin}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Lastname</f:facet>
                <h:outputText value="#{_user.lastname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Password</f:facet>
                <h:outputText value="#{_user.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Registered</f:facet>
                <h:outputText value="#{_user.registered}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Role id</f:facet>
                <h:outputText value="#{_user.role.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status id</f:facet>
                <h:outputText value="#{_user.status.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Username</f:facet>
                <h:outputText value="#{_user.username}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewuser"
                     value="View"
                      view="/User.xhtml">
                    <f:param name="userId"
                           value="#{_user.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Status</h:panelGroup>
        </f:facet>
    <div class="association" id="statusParent">

        <h:outputText value="There is no status associated with this photo."
                   rendered="#{photoHome.instance.status == null}"/>

        <rich:dataTable var="_status"
                   value="#{photoHome.instance.status}"
                rendered="#{photoHome.instance.status != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="statusTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_status.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Dsc</f:facet>
                <h:outputText value="#{_status.dsc}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status</f:facet>
                <h:outputText value="#{_status.status}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewstatus"
                     value="View"
                      view="/Status.xhtml">
                    <f:param name="statusId"
                           value="#{_status.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
